home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat1 / rfind.z / rfind
Text File  |  1998-10-20  |  42KB  |  793 lines

  1.  
  2.  
  3.  
  4. RRRRFFFFIIIINNNNDDDD((((1111))))                                                              RRRRFFFFIIIINNNNDDDD((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      rfind - remote find
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      rrrrffffiiiinnnndddd [----ddddeeeebbbbuuuugggg] file-system search-expression
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      _r_f_i_n_d is a fast, client-server adaptation of the _f_i_n_d(1) command.  It
  16.      maps the specified _f_i_l_e-_s_y_s_t_e_m name to a host machine, and submits the
  17.      _s_e_a_r_c_h-_e_x_p_r_e_s_s_i_o_n to the _r_f_i_n_d_d(1M) daemon running on that host, for
  18.      evaluation over the specified _f_i_l_e-_s_y_s_t_e_m.  The _r_f_i_n_d_d(1M) daemon
  19.      searches side files for the requested information, and returns it to
  20.      _r_f_i_n_d(1) for display on stdout.  These side files were previously created
  21.      by the _f_s_d_u_m_p(1M) command, and contain information about a particular
  22.      _f_i_l_e-_s_y_s_t_e_m
  23.  
  24.      If the ----ddddeeeebbbbuuuugggg option is specified, then _r_f_i_n_d will display the result of
  25.      parsing the _f_i_l_e-_s_y_s_t_e_m and _s_e_a_r_c_h-_e_x_p_r_e_s_s_i_o_n on stdout.
  26.  
  27.    FFFFiiiilllleeee----SSSSyyyysssstttteeeemmmm
  28.      The _f_i_l_e-_s_y_s_t_e_m to be searched may be specified in one of three forms:
  29.      canonical, alias or local path.  Only one _f_i_l_e-_s_y_s_t_e_m may be specified.
  30.      Remaining arguments are considered to be part of the _s_e_a_r_c_h-_e_x_p_r_e_s_s_i_o_n.
  31.  
  32.      If the _f_i_l_e-_s_y_s_t_e_m argument contains a colon ':' character, then it is
  33.      considered to be in ccccaaaannnnoooonnnniiiiccccaaaallll ffffoooorrrrmmmm.  The portion of the name before the
  34.      first ':'  is taken as the network hostname, and the remaining characters
  35.      after this ':' are taken as the full pathname of the file system subtree
  36.      to searched.  For example, the command:
  37.  
  38.            rfind bonnie.wpd:/cypress/att/usr/src foo.c
  39.  
  40.      will send a request to the _r_f_i_n_d_d(1M) daemon on the host bonnie.wpd, to
  41.      search for the file foo.c below the directory /cypress/att/usr/src
  42.      (staying within whatever file system contains this path).
  43.  
  44.      If the _f_i_l_e-_s_y_s_t_e_m argument does not contain a ':' character, then a list
  45.      of standard locations is searched in an attempt to resolve the _f_i_l_e-
  46.      _s_y_s_t_e_m as an aaaalllliiiiaaaassss.  Four places are searched, in order:
  47.  
  48.      1)  the file referenced by the RRRRFFFFIIIINNNNDDDD____AAAALLLLIIIIAAAASSSSEEEESSSS environment variable, if any
  49.  
  50.      2)  the file ////eeeettttcccc////rrrrffffiiiinnnndddd....aaaalllliiiiaaaasssseeeessss
  51.  
  52.      3)  the NIS (Yellow Pages) map called rfind.aliases
  53.  
  54.      4)  a hardwired internal list which aliases "root" and "usr" to
  55.          "localhost:/" and "localhost:/usr", respectively.
  56.  
  57.      The first of these places to specify a mapping for the _f_i_l_e-_s_y_s_t_e_m alias
  58.      is used.  See the comments in the file ////eeeettttcccc////rrrrffffiiiinnnndddd....aaaalllliiiiaaaasssseeeessss for a
  59.      description of that file's format.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. RRRRFFFFIIIINNNNDDDD((((1111))))                                                              RRRRFFFFIIIINNNNDDDD((((1111))))
  71.  
  72.  
  73.  
  74.      If the _f_i_l_e-_s_y_s_t_e_m argument is neither in canonical form nor an alias,
  75.      then it is considered to be a llllooooccccaaaallll ppppaaaatttthhhh to either an EFS, XFS or NFS
  76.      directory or other file.  The path need not begin with a slash.  Any
  77.      referenced symbolic links are fully resolved where possible to their
  78.      final target.
  79.  
  80.      The inode named by the local path is examined.  If it resides on an "efs"
  81.      or "xfs" file system, then the request is sent to _r_f_i_n_d_d(1M) on the
  82.      localhost for resolution.  If it resides on an "nfs" file system, then
  83.      the file ////eeeettttcccc////mmmmttttaaaabbbb is examined to determine the hostname of the server to
  84.      send the request to.  For example, the command:
  85.  
  86.            rfind /cypress/att/usr/src foo.c
  87.  
  88.      will, in the case that bonnie.wpd:/cypress is mounted to /cypress (or, if
  89.      /cypress is a symlink, to the target of that symlink), send the same
  90.      request as the previous example.  If the named inode is in an automounted
  91.      (see _a_u_t_o_m_o_u_n_t(1M)) file system, then that file system will be
  92.      automounted if it wasn't already.  The local mount point need not be
  93.      isomorphic with the server's pathname for this file system.
  94.  
  95.      If none of these mechanisms succeeds, then _r_f_i_n_d(1) displays a list of
  96.      all known aliases on its error output and exits with non-zero status.
  97.  
  98.    SSSSeeeeaaaarrrrcccchhhh----EEEExxxxpppprrrreeeessssssssiiiioooonnnn
  99.      _r_f_i_n_d accepts a boolean _s_e_a_r_c_h-_e_x_p_r_e_s_s_i_o_n, written in the primaries given
  100.      below, that has a syntax similar to that of the _f_i_n_d(1) command.
  101.  
  102.      In the descriptions, the argument _n is used as a decimal integer where ++++_n
  103.      means strictly greater than _n, ----_n means strictly less than _n and _n means
  104.      exactly _n.  Valid expressions are:
  105.  
  106.      ----nnnnaaaammmmeeee _f_i_l_e      True if _f_i_l_e matches as many trailing components of the
  107.                      current file's pathname as are specified in the pattern
  108.                      _f_i_l_e.  The wildcard characters [[[[, !!!!, ----, ????  and **** may be
  109.                      used to specify filename patterns.  See the section _F_i_l_e
  110.                      _N_a_m_e _G_e_n_e_r_a_t_i_o_n of _s_h(1) for their usage.  If the first
  111.                      character of _f_i_l_e is the slash //// character, then all
  112.                      components of the current file's pathname must match.
  113.  
  114.      ----rrrrooooooootttt _p_a_t_h      True if the current file is located in the _f_i_l_e-_s_y_s_t_e_m
  115.                      hierarchy somewhere under the directory specified by
  116.                      _p_a_t_h.  If _p_a_t_h specifies a file that is not a directory,
  117.                      then this primary is true for just that specified file.
  118.  
  119.      ----ppppeeeerrrrmmmm [----]_o_n_u_m   True if the file permission flags exactly match the octal
  120.                      number _o_n_u_m (see _c_h_m_o_d(1)).  If _o_n_u_m is prefixed by a
  121.                      minus sign, only the bits that are set in _o_n_u_m are
  122.                      compared with the file permission flags, and the
  123.                      expression evaluates true if they match.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. RRRRFFFFIIIINNNNDDDD((((1111))))                                                              RRRRFFFFIIIINNNNDDDD((((1111))))
  137.  
  138.  
  139.  
  140.      ----ttttyyyyppppeeee _c         True if the type of the file is _c, where _c is bbbb, cccc, dddd, llll,
  141.                      pppp, ffff, or ssss for block special file, character special
  142.                      file, directory, symbolic link, fifo (a.k.a named pipe),
  143.                      plain file, or socket respectively.
  144.  
  145.      ----lllliiiinnnnkkkkssss _n        True if the file has _n links.
  146.  
  147.      ----uuuusssseeeerrrr _u_n_a_m_e     True if the file belongs to the user _u_n_a_m_e.  If _u_n_a_m_e is
  148.                      numeric and does not appear as a login name in the
  149.                      ////eeeettttcccc////ppppaaaasssssssswwwwdddd file, it is taken as a decimal user ID.
  150.  
  151.      ----ggggrrrroooouuuupppp _g_n_a_m_e    True if the file belongs to the group _g_n_a_m_e.  If _g_n_a_m_e is
  152.                      numeric and does not appear in the ////eeeettttcccc////ggggrrrroooouuuupppp file, it is
  153.                      taken as a decimal group ID.
  154.  
  155.      ----ssssiiiizzzzeeee _n[cccc]      True if the file is _n blocks long (512 bytes per block).
  156.                      If _n is followed by a cccc, the size is in characters.
  157.  
  158.      ----iiiinnnnuuuummmm _n         True if _n is the inode number of the file.  If -_i_n_u_m is
  159.                      used to display a single inode (that is, if the _n inode
  160.                      number specified is not prefixed with a ++++ or ----), and if
  161.                      the current inode has multiple links, then the pathname
  162.                      of only one of the links is available for printing.
  163.  
  164.      ----aaaattttiiiimmmmeeee _n        True if the file has been accessed in _n days (see _s_t_a_t(2)
  165.                      for a description of which file operations change the
  166.                      access time of a file).
  167.  
  168.      ----mmmmttttiiiimmmmeeee _n        True if the file has been modified in _n days (see _s_t_a_t(2)
  169.                      for a description of which file operations change the
  170.                      modification time of a file).
  171.  
  172.      ----ccccttttiiiimmmmeeee _n        True if the file has been changed in _n days (see _s_t_a_t(2)
  173.                      for a description of which file operations change the
  174.                      change time of a file).
  175.  
  176.      ----pppprrrriiiinnnntttt          Always true; causes the current path name to be printed.
  177.  
  178.      ----llllssss             Always true; causes current pathname to be printed
  179.                      together with its associated statistics.  These include
  180.                      (respectively) inode number, protection mode, number of
  181.                      hard links, user, group, size in bytes, and modification
  182.                      time.  If the file is a special file the size field will
  183.                      instead contain the major and minor device numbers.  If
  184.                      the file is a symbolic link the pathname of the linked-to
  185.                      file is printed preceded by ->.  The format is identical
  186.                      to that of _l_s -_l_i_d, however the formatting is done
  187.                      internally, without executing the _l_s program.
  188.  
  189.      ----pppprrrriiiinnnnttttffff _f_o_r_m_a_t  Always true; causes information about the current file to
  190.                      be printed using the specified _f_o_r_m_a_t.  The _f_o_r_m_a_t is a
  191.                      character string that contains three kinds of objects:
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. RRRRFFFFIIIINNNNDDDD((((1111))))                                                              RRRRFFFFIIIINNNNDDDD((((1111))))
  203.  
  204.  
  205.  
  206.                      1) plain characters, which are simply copied to the
  207.                      output stream, 2) the C-like escape sequences \\\\bbbb, \\\\ffff, \\\\nnnn,
  208.                      \\\\rrrr, \\\\tttt and \\\\vvvv, which are converted (see _e_c_h_o(1) for their
  209.                      meaning), and 3) conversion specifications, each of which
  210.                      results in displaying in decimal or string form the value
  211.                      of a particular attribute of the current file.  The
  212.                      conversion specifications recognized are described below
  213.                      in the section _P_r_i_n_t_f _F_o_r_m_a_t.
  214.  
  215.      ----nnnncccchhhheeeecccckkkk _n       True if _n is the inode number of the current file.
  216.                      Causes the inode number and full pathname for each link
  217.                      to the current file to be displayed in the fixed format
  218.                      "%i\t%P\n" for each link to the current file.  The output
  219.                      resembles that from the _n_c_h_e_c_k(1) command.
  220.  
  221.      ----nnnnoooonnnneeee           Always true; suppresses the default ----pppprrrriiiinnnntttt operator in
  222.                      the case that none of the operators ----llllssss, ----pppprrrriiiinnnntttt, ----pppprrrriiiinnnnttttffff,
  223.                      or ----nnnncccchhhheeeecccckkkk were supplied.
  224.  
  225.      ----nnnneeeewwwweeeerrrr _p_a_t_h     True if the current file has been modified more recently
  226.                      than the argument _p_a_t_h.  The file specified by _p_a_t_h must
  227.                      be root based, and reference a file within the _f_i_l_e-
  228.                      _s_y_s_t_e_m that is being searched.  See _s_t_a_t(2) for a
  229.                      description of which file operations change the
  230.                      modification time of a file.
  231.  
  232.      ----aaaannnneeeewwwweeeerrrr _p_a_t_h    True if current file has been accessed more recently than
  233.                      the argument _p_a_t_h.  The file specified by _p_a_t_h must be
  234.                      root based, and reference a file within the _f_i_l_e-_s_y_s_t_e_m
  235.                      that is being searched.  See _s_t_a_t(2) for a description of
  236.                      which file operations change the access time of a file.
  237.  
  238.      ----ccccnnnneeeewwwweeeerrrr _p_a_t_h    True if current file has been changed more recently than
  239.                      the argument _p_a_t_h.  The file specified by _p_a_t_h must be
  240.                      root based, and reference a file within the _f_i_l_e-_s_y_s_t_e_m
  241.                      that is being searched.  See _s_t_a_t(2) for a description of
  242.                      which file operations change the change time of a file.
  243.  
  244.      ----ddddeeeepppptttthhhh          Always true; causes descent of the directory hierarchy to
  245.                      be done so that all entries in a directory are acted on
  246.                      before the directory itself.
  247.  
  248.      ----pppprrrruuuunnnneeee          Always true; has the side effect of pruning the search
  249.                      tree at the current file.  If the current path name is a
  250.                      directory, _r_f_i_n_d will not descend below directory.
  251.  
  252.      ----ffffoooolllllllloooowwww         Always true; causes the underlying file of a symbolic
  253.                      link to be checked rather than the symbolic link itself.
  254.  
  255.      ----sssshhhhoooowwwwddddoooottttssss       Always true; causes the conventional "." and ".." entries
  256.                      of each directory to become visible.  Normally these
  257.                      entries are suppressed unless explicitly named by path or
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. RRRRFFFFIIIINNNNDDDD((((1111))))                                                              RRRRFFFFIIIINNNNDDDD((((1111))))
  269.  
  270.  
  271.  
  272.                      inode number.
  273.  
  274.      ----cccchhhhaaaannnnggggeeeedddd        True if executing the _s_t_a_t(2) system call from the
  275.                      _r_f_i_n_d_d(1M) daemon on the full pathname of the current
  276.                      file yields a result that does not have the same file
  277.                      type, modification time, change time and size values as
  278.                      were observed for the current file when it was last
  279.                      examined by _f_s_d_u_m_p(1M).  In the case that the current
  280.                      file is a directory, then the logic of the ----cccchhhhaaaannnnggggeeeedddd
  281.                      operator is optimized for use by _p_t_o_o_l_s(1), a software
  282.                      source control tool used internally by Silicon Graphics,
  283.                      and involves executing the _s_t_a_t(2) system call for every
  284.                      directory that contains any link (hard or symbolic) of
  285.                      any file contained within the current directory.
  286.  
  287.      ----nnnneeeewwwwddddiiiirrrraaaadddddddd  ffffoooorrrrmmmmaaaatttt
  288.                      True if executing the _s_t_a_t(2) system call from the
  289.                      _r_f_i_n_d_d(1M) daemon on the full pathname of the current
  290.                      file yields a result that does not have the same file
  291.                      type, modification time, change time and size values as
  292.                      were observed for the current file when it was last
  293.                      examined by _f_s_d_u_m_p(1M) and that it is a directory which
  294.                      contains subdirectories which previously did not exist or
  295.                      were of a different type.  The information about these
  296.                      directories is printed using the specified format.
  297.  
  298.      ----ssssttttccccoooouuuunnnntttt        Always true; subtree count - increments running subtree
  299.                      total by a count of one.  The subtree options are
  300.                      described below in the section _S_u_b_t_r_e_e _O_p_t_i_o_n_s.
  301.  
  302.      ----ssssttttssssiiiizzzzeeee         Always true; subtree size - increments running subtree
  303.                      total by the number of blocks in the current file.  The
  304.                      subtree options are described below in the section
  305.                      _S_u_b_t_r_e_e _O_p_t_i_o_n_s.
  306.  
  307.      ----ssssttttttttoooottttaaaallll _t_h_r_e_s_h_o_l_d
  308.                      True if the running subtree total exceeds the specified
  309.                      decimal _t_h_r_e_s_h_o_l_d, or if the running subtotal is non-zero
  310.                      and the current path being evaluated is the final, root
  311.                      path.  If true, copies the running subtotal to the
  312.                      aggregate subtotal, and zeros the running subtotal.  The
  313.                      subtree options are described below in the section
  314.                      _S_u_b_t_r_e_e _O_p_t_i_o_n_s.
  315.  
  316.      ----eeeexxxxiiiitttt _s_t_a_t_u_s    If executed during the course of evaluating the _s_e_a_r_c_h-
  317.                      _e_x_p_r_e_s_s_i_o_n, causes _r_f_i_n_d(1) to exit immediately with the
  318.                      specified decimal _s_t_a_t_u_s.
  319.  
  320.      (((( _e_x_p_r_e_s_s_i_o_n ))))  True if the parenthesized expression is true (parentheses
  321.                      are special to the shell and must be escaped).
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. RRRRFFFFIIIINNNNDDDD((((1111))))                                                              RRRRFFFFIIIINNNNDDDD((((1111))))
  335.  
  336.  
  337.  
  338.      The primaries may be combined using the following operators (in order of
  339.      decreasing precedence):
  340.  
  341.      1)  The negation of a primary (!!!!  is the unary _n_o_t operator).
  342.  
  343.      2)  Concatenation of primaries (the _a_n_d operation is implied by the
  344.          juxtaposition of two primaries).  The _a_n_d operator may also be
  345.          specified as ----aaaa.
  346.  
  347.      3)  Alternation of primaries (----oooo is the _o_r operator).
  348.  
  349.    PPPPrrrriiiinnnnttttffff FFFFoooorrrrmmmmaaaatttt
  350.      This section describes the conversion specifications accepted by the
  351.      ----pppprrrriiiinnnnttttffff _f_o_r_m_a_t option.  Each conversion specification consists of the
  352.      character %%%% and a single following conversion character.  Numeric
  353.      quantities are output in decimal, except for permissions, which are
  354.      octal.
  355.  
  356.      The conversion specifications and their meanings are:
  357.  
  358.      %%%%aaaa,%%%%cccc,%%%%mmmm  The access (atime), change (ctime) or modification (mtime) time
  359.                stamps for the current file, as seconds since the epoch.
  360.  
  361.      %%%%uuuu,%%%%gggg     The numeric user (uid) or group (id) for the current file.
  362.  
  363.      %%%%pppp        The octal permissions (mode, including type) for the current
  364.                file.
  365.  
  366.      %%%%nnnn        The number of links to the current file.
  367.  
  368.      %%%%iiii        The inode number of the current file.
  369.  
  370.      %%%%ssss        The size in bytes of the current file.
  371.  
  372.      %%%%eeee        The NFS internal generation number (gen) of the current file.
  373.  
  374.      %%%%dddd        For block and character special files, the major/minor device
  375.                (rdev) of the current file.  For other file types, this is
  376.                zero.
  377.  
  378.      %%%%xxxx        For directory and regular files, the number of EFS extents.
  379.                For other file types, this is zero.
  380.  
  381.      %%%%NNNN        The actual number of links observed when _f_s_d_u_m_p(1M) traversed
  382.                the _f_i_l_e-_s_y_s_t_e_m.  This will usually be the same value as for
  383.                %%%%nnnn, above, unless either a concurrent update caused
  384.                inconsistent data to be captured (rare but allowed), or
  385.                _f_s_d_u_m_p(1M) lacked permissions to scan part of the directory
  386.                structure (in which case, inode contents are still available,
  387.                but names are not).  The _f_s_d_u_m_p(1M) command runs setuid root
  388.                only long enough to obtain a read only file descriptor on the
  389.                target _f_i_l_e-_s_y_s_t_e_m in order to read inode contents, then
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. RRRRFFFFIIIINNNNDDDD((((1111))))                                                              RRRRFFFFIIIINNNNDDDD((((1111))))
  401.  
  402.  
  403.  
  404.                restores its invoker's privileges.
  405.  
  406.      %%%%EEEE        For directories, the number of directory entries observed when
  407.                _f_s_d_u_m_p(1M) traversed the _f_i_l_e-_s_y_s_t_e_m.
  408.  
  409.      %%%%SSSS        The number of active inodes below this inode in the _f_i_l_e-_s_y_s_t_e_m
  410.                hierarchy.  This value is only non-zero for directories.  The
  411.                conventional "." and ".." directory entries are included in
  412.                this count.
  413.  
  414.      %%%%IIII        The total number of active inodes in the _f_i_l_e-_s_y_s_t_e_m.
  415.  
  416.      %%%%MMMM        The pathname of the mount point on which the current _f_i_l_e-
  417.                _s_y_s_t_e_m was mounted when _f_s_d_u_m_p examined it.
  418.  
  419.      %%%%QQQQ        One of the "file environment" attributes:  a quick and dirty
  420.                checksum of just the first 8 bytes of each 512 block of the
  421.                file, plus the inode number of the file.
  422.  
  423.      %%%%YYYY        One of the "file environment" attributes:  If the current file
  424.                is a symbolic link, displays the path contained in the link
  425.                file.  If the file is not a symbolic link, or its contents
  426.                could not be read by _f_s_d_u_m_p(1M), then displays the empty
  427.                string.
  428.  
  429.      %%%%UUUU        Aggregate subtree total - see further the section _S_u_b_t_r_e_e
  430.                _O_p_t_i_o_n_s.
  431.  
  432.      %%%%RRRR        One of the "file environment" attributes:  the top-of-trunk RCS
  433.                delta number.  This value is maintained for files that appear
  434.                to be RCS ,v files, and is the empty string for other files.
  435.  
  436.      %%%%TTTT        One of the "file environment" attributes:  the top-of-trunk RCS
  437.                date stamp.  This value is maintained for files that appear to
  438.                be RCS ,v files, and is the empty string for other files.
  439.  
  440.      %%%%LLLL        One of the "file environment" attributes:  the user name of the
  441.                locker of locked RCS ,v files.  For any other file, this is the
  442.                empty string.
  443.  
  444.      %%%%AAAA        One of the "file environment" attributes:  the user name of the
  445.                author of the RCS top-of-trunk delta.  For other files, this is
  446.                the empty string.
  447.  
  448.      %%%%DDDD        The pathname of the directory containing the current file, or
  449.                dirname.
  450.  
  451.      %%%%BBBB        The basename of the current file.
  452.  
  453.      %%%%PPPP        The full pathname of the current file.
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. RRRRFFFFIIIINNNNDDDD((((1111))))                                                              RRRRFFFFIIIINNNNDDDD((((1111))))
  467.  
  468.  
  469.  
  470.      %%%%WWWW        The canonical full pathname of the current file.  If the _f_i_l_e-
  471.                _s_y_s_t_e_m argument to _r_f_i_n_d passes through a symlink, then the
  472.                "%P" format will show you a pathname relative to the path
  473.                provided in the _f_i_l_e-_s_y_s_t_e_m argument, whereas "%W" will show
  474.                you the canonical pathname, free of symlinks.
  475.  
  476.      %%%%ZZZZ        The full pathname of the new subdirectory within the current
  477.                file.
  478.  
  479.      %%%%%%%%        Same as %.
  480.  
  481.    SSSSuuuubbbbttttrrrreeeeeeee OOOOppppttttiiiioooonnnnssss
  482.      The ----ssssttttccccoooouuuunnnntttt, ----ssssttttssssiiiizzzzeeee and ----ssssttttttttoooottttaaaallll options, together with the ----pppprrrriiiinnnnttttffff
  483.      "%U" format, provide a mechanism to group subtrees of the searched tree
  484.      by sizes or counts.  The ----ssssttttttttoooottttaaaallll option implies the ----ddddeeeepppptttthhhh option.  The
  485.      _r_f_i_n_d command maintains two internal values, the running subtotal and the
  486.      aggregate subtotal.  Both values are initialized to zero.
  487.  
  488.      The running subtotal is maintained during the recursive depth first
  489.      search so that for directories it is always the total values not already
  490.      aggregated for the subtree below the directory, and for other files, it
  491.      is always the value for just that file.  The aggregate subtotal is reset
  492.      to zero before evaluating the _s_e_a_r_c_h-_e_x_p_r_e_s_s_i_o_n for each file.
  493.  
  494.      Whenever the ----ssssttttccccoooouuuunnnntttt option is evaluated, it increments the running
  495.      subtotal by one.
  496.  
  497.      Whenever the ----ssssttttssssiiiizzzzeeee option is evaluated, it increments the running
  498.      subtotal by the size in blocks of the current file.
  499.  
  500.      Whenever, for an individual file or for a subtree, the ----ssssttttttttoooottttaaaallll option is
  501.      evaluated and the current running subtotal exceeds the _t_h_r_e_s_h_o_l_d
  502.      specified on the ----ssssttttttttoooottttaaaallll option, then the running subtotal is copied to
  503.      the aggregate subtotal, and the running subtotal is reset to zero.  When
  504.      evaluating the _s_e_a_r_c_h-_e_x_p_r_e_s_s_i_o_n for the final (top) directory of the
  505.      search (namely, the directory specified or implied by the ----rrrrooooooootttt option),
  506.      the ----ssssttttttttoooottttaaaallll option copies any non-zero running subtotal to the aggregate
  507.      subtotal, even if it does not exceed the specified _t_h_r_e_s_h_o_l_d, and
  508.      evaluates as true if a copy was done.
  509.  
  510.      The ----pppprrrriiiinnnnttttffff "%U" format displays the current value of the aggregate
  511.      subtotal.
  512.  
  513.      These options are intended to be used together.  Typically one of either
  514.      the ----ssssttttccccoooouuuunnnntttt or ----ssssttttssssiiiizzzzeeee option is used to increment the running subtotal,
  515.      along with the ----ssssttttttttoooottttaaaallll option to copy the running subtotal to the
  516.      aggregate subtotal whenever the threshold is reached, along with the
  517.      ----pppprrrriiiinnnnttttffff "%U" format to display the aggregate subtotal.
  518.  
  519.      For example, one could determine where, in a large RCS based source tree,
  520.      the recent (say, in the last day) changes to RCS/*,v files were
  521.      clustered, with the command:
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. RRRRFFFFIIIINNNNDDDD((((1111))))                                                              RRRRFFFFIIIINNNNDDDD((((1111))))
  533.  
  534.  
  535.  
  536.            rfind cypress 'RCS/*,v' -mtime -1 -stcount -o -type d -sttotal 10
  537.            -printf "%U\t%P\n"
  538.  
  539.      The output from the above command might look like:
  540.  
  541.            14   /cypress/att/usr/src/cmd/motif/clients/4Dwm/RCS
  542.            13   /cypress/att/usr/src/cmd/motif/sgi/book
  543.            12   /cypress/att/usr/src/cmd/X11R4/mit/fonts.pcf/bdf/75dpi/RCS
  544.            16   /cypress/att/usr/src/cmd/X11R4/mit
  545.            17   /cypress/att/usr/src/cmd/demo
  546.            14   /cypress/att/usr/src/cmd
  547.            11   /cypress/att/usr/src/man
  548.            10   /cypress/att/usr/src/gfx/lib/libgl/LIGHT/asmgfx/RCS
  549.            11   /cypress/att/usr/src/gfx/lib/libgl/LIGHT/cgfx/RCS
  550.            14   /cypress/att/usr/src/gfx
  551.            32   /cypress/att/usr/src
  552.            10   /cypress/bsd/src/etc/timed/RCS
  553.            1    /cypress
  554.  
  555.      The above output shows the several subtrees containing 10 or more changed
  556.      RCS/*,v files, with the number of such files in the first column.
  557.  
  558.      For another example, one could determine where disk space was being used
  559.      on the root file system with the command:
  560.  
  561.            rfind root -stsize -sttotal 1000 -printf "%U\t%P\n"
  562.  
  563.      This command produces output like the following:
  564.  
  565.            1374    /bin/wsh
  566.            1201    /bin/news_server
  567.            4991    /bin
  568.            3551    /etc/gl
  569.            3651    /etc
  570.            2192    /stand/ide
  571.            2817    /unix
  572.            1961    /
  573.  
  574.      From this output, one can see that three individual files, /bin/wsh,
  575.      /bin/news_server and /unix, exceeded the 1000 block threshold, that most
  576.      of the remaining disk space is in use by files under the directories
  577.      /bin, /etc/gl, /etc and /stand/ide, and that 1961 blocks of data resides
  578.      somewhere else on the root file system.
  579.  
  580.    DDDDeeeeffffaaaauuuullllttttssss
  581.      To make interactive use easier, _r_f_i_n_d supports several default options
  582.      and primaries in the _s_e_a_r_c_h-_e_x_p_r_e_s_s_i_o_n.
  583.  
  584.      1)  A default leading option of ----rrrrooooooootttt ////rrrroooooooottttppppaaaatttthhhh is supplied, where
  585.          /rootpath is the mount point implied by the first argument to _r_f_i_n_d.
  586.  
  587.  
  588.  
  589.  
  590.  
  591.                                                                         PPPPaaaaggggeeee 9999
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. RRRRFFFFIIIINNNNDDDD((((1111))))                                                              RRRRFFFFIIIINNNNDDDD((((1111))))
  599.  
  600.  
  601.  
  602.      2)  The _s_e_a_r_c_h-_e_x_p_r_e_s_s_i_o_n is parsed from left to right in two phases.
  603.  
  604.      3)  Unexpected arguments in the first phase that begin with the '////'
  605.          character are supplied a default ----rrrrooooooootttt option.
  606.  
  607.      4)  The ----rrrrooooooootttt _p_a_t_h primaries constructed during the first phase are
  608.          automatically separated from each other by the ----oooo operator.
  609.  
  610.      5)  The first phase ends at the first argument that is neither an
  611.          explicit ----rrrrooooooootttt nor starts with the '////' character.
  612.  
  613.      6)  At the end of the first phase, an automatic opening (((( parenthesis is
  614.          inserted, so that the entire list of ----oooo separated roots just built is
  615.          concatenated (implying the ----aaaa operator) with the expression resulting
  616.          from the second phase.
  617.  
  618.      7)  Unexpected arguments in the second phase that do not begin with the
  619.          '----' character are supplied a default ----nnnnaaaammmmeeee option.
  620.  
  621.      8)  At the end of the second phase, sufficient closing )))) parentheses are
  622.          supplied to match any unmatched opening (((( parentheses.
  623.  
  624.      9)  Finally, if none of the operators ----llllssss, ----pppprrrriiiinnnntttt, ----pppprrrriiiinnnnttttffff, ----nnnnoooonnnneeee or
  625.          ----nnnncccchhhheeeecccckkkk appeared, a default ----pppprrrriiiinnnntttt operator is supplied.
  626.  
  627.      The result of the above defaults is that the command:
  628.  
  629.            rfind cypress ed.c
  630.  
  631.      is automatically expanded into the equivalent command:
  632.  
  633.            rfind cypress -root /cypress -a  \( -name ed.c \) -print
  634.  
  635.      and that the command:
  636.  
  637.            rfind bugs /d1/Bugs /d1/alphabugs 1234
  638.  
  639.      is automatically expanded into the command:
  640.  
  641.            rfind bugs -root /d1 -a \( -root /d1/Bugs -o -root /d1/alphabugs \)
  642.            -a \( -name 1234 \) -print
  643.  
  644.    PPPPeeeerrrrffffoooorrrrmmmmaaaannnncccceeee
  645.      The _r_f_i_n_d_d (_1_M) daemon dynamically selects from several available search
  646.      strategies in order to provide optimum performance.
  647.  
  648.      1)  The ----rrrrooooooootttt _p_a_t_h option may be used to specify a small portion of the
  649.          _f_i_l_e-_s_y_s_t_e_m to be searched.
  650.  
  651.      2)  The ----nnnnaaaammmmeeee _f_i_l_e option may take advantage of a secondary sort index by
  652.          file basename.  The first wildcard character [[[[, ????  or **** in the
  653.          basename of the provided name terminates the portion of the basename
  654.  
  655.  
  656.  
  657.                                                                        PPPPaaaaggggeeee 11110000
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. RRRRFFFFIIIINNNNDDDD((((1111))))                                                              RRRRFFFFIIIINNNNDDDD((((1111))))
  665.  
  666.  
  667.  
  668.          which is used to restrict the search.
  669.  
  670.      3)  If the ----iiiinnnnuuuummmm _n or ----nnnncccchhhheeeecccckkkk _n options are used, then direct and rapid
  671.          lookup is possible.
  672.  
  673.      4)  If the either of the options ----pppprrrruuuunnnneeee or ----ddddeeeepppptttthhhh are used, then this
  674.          disables the above search strategies (2) by name and (3) by inode
  675.          number.
  676.  
  677.      Small searches that are able to take advantage of one of the above search
  678.      strategies often complete in less than 1 second.  Large searches that
  679.      require walking a large tree can take up to several minutes, depending
  680.      primarily on server performance.
  681.  
  682.      The selection of search strategy is based on dynamically computed
  683.      weights, so two _r_f_i_n_d(1) commands that are syntactically identical may be
  684.      accomplished by different strategies depending for example on the
  685.      relative size of the subtrees specified by ----rrrrooooooootttt _p_a_t_h options and the
  686.      relative portion of the name space covered by ----nnnnaaaammmmeeee _f_i_l_e options.
  687.  
  688.      The order of output is dependent on the search order.  In the case that
  689.      the secondary sort index by file basename is used, the output will not
  690.      appear to have any particular order.
  691.  
  692.    CCCCoooommmmppppaaaarrrriiiissssoooonnnn ttttoooo ffffiiiinnnndddd((((1111))))
  693.      The _r_f_i_n_d(1) has the following new options that are not available in the
  694.      _f_i_n_d(1) command:  ----rrrrooooooootttt, ----llllssss, ----pppprrrriiiinnnnttttffff, ----nnnnoooonnnneeee, ----nnnncccchhhheeeecccckkkk, ----sssshhhhoooowwwwddddoooottttssss,
  695.      ----ssssttttccccoooouuuunnnntttt, ----ssssttttssssiiiizzzzeeee, ----ssssttttttttoooottttaaaallll, ----cccchhhhaaaannnnggggeeeedddd and ----eeeexxxxiiiitttt.
  696.  
  697.      The following _f_i_n_d(1) options are not available in _r_f_i_n_d(1):  ----ccccppppiiiioooo, ----ooookkkk,
  698.      ----eeeexxxxeeeecccc, ----llllooooccccaaaallll and ----mmmmoooouuuunnnntttt.  Since the preferred way to create cpio
  699.      archives is to use the _c_p_i_o(1) command itself, perhaps receiving
  700.      filenames via a pipe from the _f_i_n_d(1) command, it did not seem worthwhile
  701.      to maintain the obsolete variant of _c_p_i_o that is embedded in the _f_i_n_d(1)
  702.      command.  Since the _r_f_i_n_d(1) uses _r_p_c(3R) with minimal authentication,
  703.      the ----ooookkkk and ----eeeexxxxeeeecccc options would have presented unacceptable security
  704.      compromises.  Since the _r_f_i_n_d(1) command only works on a single _f_i_l_e-
  705.      _s_y_s_t_e_m, the ----llllooooccccaaaallll and ----mmmmoooouuuunnnntttt options are effectively always on.
  706.  
  707.      The _f_i_n_d(1) searches in realtime on multiple file systems, whereas
  708.      _r_f_i_n_d(1) searches the previously created side file of a single file
  709.      system.
  710.  
  711.      The _f_i_n_d(1) command is a single process utility, whereas the _r_f_i_n_d(1)
  712.      command is the frontend of client-server utility.
  713.  
  714.      Searching a large file system is many times faster with _r_f_i_n_d(1) than
  715.      with _f_i_n_d(1).
  716.  
  717.      The ----nnnnaaaammmmeeee _f_i_l_e option of _r_f_i_n_d(1) supports multiple components in the
  718.      pattern _f_i_l_e.
  719.  
  720.  
  721.  
  722.  
  723.                                                                        PPPPaaaaggggeeee 11111111
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. RRRRFFFFIIIINNNNDDDD((((1111))))                                                              RRRRFFFFIIIINNNNDDDD((((1111))))
  731.  
  732.  
  733.  
  734.      The command line defaults simplify the use of _r_f_i_n_d(1).
  735.  
  736.    EEEExxxxaaaammmmpppplllleeeessss
  737.      To find all files named 'find*' in Cypress:
  738.  
  739.            rfind cypress 'find*'
  740.  
  741.      To display all character special devices on the root file system except
  742.      those under any ddddeeeevvvv directory:
  743.  
  744.            rfind root -type d -name dev -prune -o -type c -print
  745.  
  746.      To find all symbolic links that point off the current file system (or
  747.      point nowhere):
  748.  
  749.            rfind cypress -follow -type l
  750.  
  751.      To display the grand total number of blocks contained in all files and
  752.      (recursively) directories within a directory subtree rooted at $P, where
  753.      $P is the canonical (symlink free) absolute (root based) path to the top
  754.      of the subtree:
  755.  
  756.            rfind $P -stsize $P -sttotal 1 -printf "%U\t%P\n"
  757.  
  758.      The output of the above command is similar to the output of:
  759.  
  760.            du -s $P
  761.  
  762. FFFFIIIILLLLEEEESSSS
  763.      /etc/rfind.aliases       List of _f_i_l_e-_s_y_s_t_e_m mappings.
  764.  
  765.      /etc/passwd              UID information supplier
  766.  
  767.      /etc/group               GID information supplier
  768.  
  769. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  770.      chmod(1), cpio(1), echo(1), find(1), fsdump(1M), ncheck(1), rfindd(1M),
  771.      sh(1), test(1).
  772.      stat(2), umask(2), rpc(3R), fs(4).
  773.  
  774. BBBBUUUUGGGGSSSS
  775.      Do not use the ----pppprrrruuuunnnneeee option with either of the ----ddddeeeepppptttthhhh or ----ssssttttttttoooottttaaaallll
  776.      options, because the alternative tree walk order used by these options
  777.      confuses the logic of the ----pppprrrruuuunnnneeee option, causing the wrong _f_i_l_e-_s_y_s_t_e_m
  778.      subtree to be pruned.
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.                                                                        PPPPaaaaggggeeee 11112222
  790.  
  791.  
  792.  
  793.